<template>
  <div>
    <van-nav-bar
        title="搜索"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
  <product-card :productlist="product_title"></product-card>
  </div>
</template>

<script>
//导入公共组件productCard
import productCard from "../../../components/list/productCard";
import IndexAx from "../axios";

const ax = new IndexAx()

export default {
  name: "sonSearch",
  data(){
    return {
      msg:"我是search",
      product_title:[]
    }
  },
  components:{
    productCard
  },
  methods:{
    //获取商品数据
    getProductList(title){
      ax.ProductList({title:title}).then(response=>{
        this.product_title = response.data.data

      })
    },

    onClickLeft(){
      this.$router.go(-1)
    }

  },
  created() {
    this.getProductList(this.$route.query.title)
  }
}
</script>

<style scoped>

</style>